package com.zygh.dlqwservice.module.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zygh.dlqwservice.module.entity.Jobs;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lee
 * @since 2020-12-24
 */
@Mapper
@Repository
public interface JobsMapper extends BaseMapper<Jobs> {
    /**
     * 返回登陆人岗位名称
     * @param jobs 封装参数
     * @return List<Jobs>
     */
    @Select("select station from jobs where dept_id = #{jobs.deptId} group by station")
    List<Jobs> getStation(@Param("jobs") Jobs jobs);

    @Select("select  concat_ws('-',gridding,name)  as name  from jobs ${ew.customSqlSegment}")
    List<Jobs> getDetail( @Param( Constants.WRAPPER )Wrapper<Jobs> wrapper);
}
